<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var sum = 100;
        var num1 = prompt('1、取钱\n2、存钱\n3、显示余额\n4、退出\n请选择你要干什么？');
        switch (parseFloat(num1)) {
            case 1:
                var money = prompt('你要取多少钱：');
                sum -= money;
                alert('你的余额为' + sum);
                break;
            case 2:
                var cun = prompt('你要存多少钱：');
                sum += parseInt(cun);
                alert('你的余额为' + sum);
                break;
            case 3:
            alert(sum);
                break;
            default:
                alert('退出');
        }
    </script>
</head>

<body>

</body>

</html>